<template>
	<div id="app" class="setting backf4">
    <div class="setting_controller">
        <a :href="'./../feedback/index.html?platform='+platform" style="border-bottom: .01rem solid #e6e6e6;">
           <div>意见反馈</div>
           <div><img src="../../../assets/img/arrow_icon.png"></div>
        </a>
        <a href="javascript:;" style="border-bottom: .01rem solid #e6e6e6;" @click="updatePassword">
          <div>修改密码</div>
           <div><img src="../../../assets/img/arrow_icon.png"></div>
        </a>
       <a :href="'./../bindaccount/index.html?platform='+platform">
         <div>账号绑定</div>
          <div><img src="../../../assets/img/arrow_icon.png"></div>
       </a> 
    </div>
    <div class="setting_controller" style="margin-top:.2rem;border-bottom: .01rem solid #e6e6e6;">
        <a href="javascript:void(0)" @click="clearcache">
           <div>清理缓存</div>
           <!-- <div><span class="cache_number">10.MB</span><img src="../../../assets/img/cache_ok.png" style="width:.28rem;height: .21rem;"></div> -->
           <div><img src="../../../assets/img/arrow_icon.png"></div>
        </a>
    </div>
    <div class="setting_controller">
        <a href="./../about/index.html">
           <div>关于我们</div>
           <div><img src="../../../assets/img/arrow_icon.png"></div>
        </a>
    </div>
    <div class="fixed_btn center" @click="exit">退出当前账号</div>
	</div>
</template>
<script>
import './index.css';
import common from 'assets/js/common';
export default {
  data() {
    return {
    	webname:5464,
      platform:''
    }
  },
  //已成功挂载，相当ready()
  mounted(){
      this.platform = common.platform;
      //修改密码
      window["updatePassFun"] = ()=>{
        if(this.platform == 'ios'){
            updatePass();
        }else{
            window.user.updatePass();
        }
      }

      //退出当前账号
      window["loginoutFun"] = ()=>{
        if(this.platform == 'ios'){
            loginout();
        }else{
            window.user.loginout();
        }
      }
  },
  //相关操作事件
  methods: {
      clearcache:function(){
         common.errMessage("清除成功！");
      },
      exit:function(){
          common.ajax({
              url:'api/user/loginout'
          }).then(res=>{
              window.loginoutFun();
          })
      },
      updatePassword:function(){
        window.updatePassFun();
      }
  }
}
</script>
